<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/struts-tags" prefix="s" %>

<table>
  <tr>
    <s:if test="sort=='id'">
      <th class="sortable sorted ${order}">
        <a href="<s:url action="mail" />?sort=id&order=${order=='asc'?'desc':'asc'}">ID</a>
      </th>
    </s:if>
    <s:else>
      <th class="sortable">
        <a href="<s:url action="mail" />?sort=id&order=asc">ID</a>
      </th>
    </s:else>
    <%--其他表格头略--%>
  </tr>
  <s:iterator value="#request.mailList" status="status">
    <tr class="${status.even?"even":"odd"}" <s:if test="!sent"> style="color:#ccc;"</s:if>>
      <td><s:property value="id" /></td>
      <td><s:property value="subject" /></td>
      <td><s:property value="from" /></td>
      <td><s:property value="to" /></td>
      <td><s:property value="cc" /></td>
      <td><s:property value="bcc" /></td>
      <td>
        <s:if test="sent">成功</s:if>
        <s:else>失败</s:else>
      </td>
      <td>
        <s:if test="attachments.size==0">&nbsp;</s:if>
        <s:else>
          <s:iterator value="attachments" status="status">
            <a href="upload/<s:property value="filename" />" target="_blank"><s:property value="filename" /></a>
            ${status.last?"":", "}
          </s:iterator>
        </s:else>
      </td>
    </tr>
  </s:iterator>
</table>
<div style="margin-top: 10px; margin-bottom: 10px;">
  ${pagination}
</div>
